From a3e5570fc02299f9104dcfc9b02e9add5bb764ae Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 29 Aug 2005 22:59:42 +0000 Subject: [PATCH] CET updates from Olaf. --- gdb.c | 75 +++++------------------------------- reference/cet/cet-sample.gpx | 10 ++--- reference/gdb-sample.gpx | 32 +++++++-------- 3 files changed, 30 insertions(+), 87 deletions(-) diff --git a/gdb.c b/gdb.c index a6f98af2b..ad32de68b 100644 --- a/gdb.c +++ b/gdb.c @@ -207,65 +207,8 @@ gdb_detect_rtept_class(const waypoint *wpt) } -#ifndef UTF8_SUPPORT -static char *gdb_garmin_to_utf8(const char *s) -{ - int len; - char *res; - unsigned char c; - char *src, *dst; - - if (s == NULL) return NULL; - - len = 0; - src = (char *)s; - while ('\0' != (c = *src++)) - { - len++; - if (c & 0x80) len++; - if (c == 0x80) len++; - } - - src = (char *)s; - dst = res = (void *) xmalloc(len + 1); - while ('\0' != (c = *src++)) - { - if (c == 0x80) - { - *dst++ = 0xe2; - *dst++ = 0x82; - *dst++ = 0xac; - } - else if (c & 0x80) - { - *dst++ = (0xc0 | (c >> 6)); - *dst++ = (c & 0xbf); - } - else - { - *dst++ = c; - } - } - *dst = '\0'; - return res; -} -#endif - /* %%% local functions (read support) %%% */ -static char * -gdb_convert_name_buff(char *buff, size_t buffsize) -{ -#ifdef UTF8_SUPPORT - char *tmp = str_garmin_to_utf8(buff); -#else - char *tmp = gdb_garmin_to_utf8(buff); -#endif - strncpy(buff, tmp, buffsize); - xfree(tmp); - return buff; -} - #ifdef GDB_DEBUG static void gdb_print_buff(const char *buff, int count, const char *comment) @@ -540,7 +483,6 @@ gdb_read_wpt(const size_t fileofs, int *wptclass) /********************************************************************************************************/ gdb_is_valid(gdb_fread_str(xname, sizeof(xname)) > 0, prefix, "new waypoint"); - gdb_convert_name_buff(xname, sizeof(xname)); gdb_fread_le(&xclass, sizeof(xclass), 32, prefix, "class"); gdb_fread_str(buff, sizeof(buff)); /* country */ @@ -553,7 +495,6 @@ gdb_read_wpt(const size_t fileofs, int *wptclass) gdb_fread_le(&xalt, sizeof(xalt), 64, prefix, "altitude"); gdb_fread_str(xnotes, sizeof(xnotes)); /* notes */ - gdb_convert_name_buff(xnotes, sizeof(xnotes)); if (gdb_fread_flag(1)) /* proximity flag */ gdb_fread_le(&xproximity, sizeof(xproximity), 64, prefix, "proximity"); @@ -575,12 +516,17 @@ gdb_read_wpt(const size_t fileofs, int *wptclass) gdb_fread(buff, 1); if (gdb_fread_flag(0)) - gdb_fread(buff, 4); - else gdb_fread(buff, 3); + else + gdb_fread(buff, 2); + + do /* undocumented & unused string */ + { + gdb_fread(buff, 1); + } + while (buff[0] != 0); - gdb_fread_str(xurl, sizeof(xurl)); - gdb_convert_name_buff(xurl, sizeof(xurl)); + gdb_fread_str(xurl, sizeof(xurl)); /* URL */ xcat = gdb_fread_le(&xcat, sizeof(xcat), 16, prefix, "category"); @@ -667,7 +613,6 @@ gdb_read_route(void) const char *prefix3 = "rte_read_final"; gdb_is_valid(gdb_fread_str(xname, sizeof(xname)) > 0, prefix, "Route has no name"); - gdb_convert_name_buff(xname, sizeof(xname)); gdb_fread_le(&auto_name, sizeof(auto_name), 8, prefix, "auto name"); if (gdb_fread_flag(0)) /* max. data flag */ @@ -703,7 +648,6 @@ gdb_read_route(void) while (count--) { gdb_fread_str(xwptname, sizeof(xwptname)); /* waypoint name */ - gdb_convert_name_buff(xwptname, sizeof(xwptname)); gdb_fread_le(&xclass, sizeof(xclass), 32, prefix1, "class"); /* class */ gdb_fread_str(buff, sizeof(buff)); /* country */ @@ -814,7 +758,6 @@ gdb_read_track(const size_t max_file_pos) const char *prefix = "trk_read_loop"; gdb_fread_str(xname, sizeof(xname)); - gdb_convert_name_buff(xname, sizeof(xname)); gdb_fread_le(&xdisplay, sizeof(xdisplay), 8, prefix0, "display"); gdb_fread_le(&xcolour, sizeof(xcolour), 32, prefix0, "colour"); diff --git a/reference/cet/cet-sample.gpx b/reference/cet/cet-sample.gpx index 9122e59be..f51bfd451 100644 --- a/reference/cet/cet-sample.gpx +++ b/reference/cet/cet-sample.gpx @@ -39,7 +39,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ CS Ovládací, Prohlížení lokální síte - Czechia (cz) + Ovládací, Prohlížení lokální síte Waypoint @@ -53,14 +53,14 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ DE Himmelmühle, ä,ö,ü,Ä,Ö,Ü,ß - ermany (de) + Himmelmühle, ä,ö,ü,Ä,Ö,Ü,ß Waypoint EO Trasercado de la loka ret - ?? (oe) + Trasercado de la loka ret Waypoint @@ -81,7 +81,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ HR Pregledavanje lokalne mreže - roatia (local name: Hrvatska) (hr) + Pregledavanje lokalne mreže Waypoint @@ -102,7 +102,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ SK Ovládacie centrum - ei D09544,Neuhausen/Cämmerswalde + Ovládacie centrum Waypoint diff --git a/reference/gdb-sample.gpx b/reference/gdb-sample.gpx index c55109130..90a54c69e 100644 --- a/reference/gdb-sample.gpx +++ b/reference/gdb-sample.gpx @@ -1,4 +1,4 @@ - + - Völkerschlachtdenkmal - P+R Am Völkerschlachtdenkmal - P+R Am Völkerschlachtdenkmal + Völkerschlachtdenkmal + P+R Am Völkerschlachtdenkmal + P+R Am Völkerschlachtdenkmal http://Voelkerschlachtdenkmal Waypoint @@ -85,7 +85,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ 416 - Fahren Sie auf die Luis-Ferdinand-Schönherr-Strasse nach Norden + Fahren Sie auf die Luis-Ferdinand-Schönherr-Strasse nach Norden Waypoint @@ -114,7 +114,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ 420 - Fahren Sie auf die Liebknechtstrasse nach Südosten + Fahren Sie auf die Liebknechtstrasse nach Südosten Waypoint @@ -250,7 +250,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ 444 - Biegen Sie links ab auf die An Der Schöpsdrehe + Biegen Sie links ab auf die An Der Schöpsdrehe Waypoint @@ -443,7 +443,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ 478 - Fahren Sie auf die August-Bebel-Strasse nach Südosten + Fahren Sie auf die August-Bebel-Strasse nach Südosten Waypoint @@ -599,7 +599,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ 508 - Biegen Sie rechts ab auf die Carthäuserstrasse + Biegen Sie rechts ab auf die Carthäuserstrasse Waypoint @@ -712,7 +712,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ 528 - Biegen Sie rechts ab auf die Gössnitzer Strasse + Biegen Sie rechts ab auf die Gössnitzer Strasse Waypoint @@ -858,13 +858,13 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ 555 - Biegen Sie rechts ab auf die Schmöllner Strasse + Biegen Sie rechts ab auf die Schmöllner Strasse Waypoint 556 - Halten Sie sich rechts in Richtung Straße + Halten Sie sich rechts in Richtung Straße Waypoint @@ -883,7 +883,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ 558 - Fahren Sie auf die Straße nach Nordosten + Fahren Sie auf die Straße nach Nordosten Waypoint @@ -1129,9 +1129,9 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ - Völkerschlachtdenkmal - P+R Am Völkerschlachtdenkmal - P+R Am Völkerschlachtdenkmal + Völkerschlachtdenkmal + P+R Am Völkerschlachtdenkmal + P+R Am Völkerschlachtdenkmal http://Voelkerschlachtdenkmal Waypoint -- 2.30.2